<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2023-01-10 11:34:28
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-01-10 12:05:57
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var time = new Date();
        console.log(time); 
        // 设置时间
        time.setFullYear(2024);
        console.log('设置年份',time);
        time.setMonth(5); 
        console.log('设置月份',time);
        time.setDate(30); 
        console.log('设置天',time); 
        time.setHours(23); 
        console.log('设置小时',time); 
        time.setMinutes(55);
        console.log('设置分钟',time); 
        time.setSeconds(30);
        console.log('设置秒',time); 
        time.setMilliseconds(6666);
        console.log('设置毫秒',time); 

        time.setTime(1673322303000);
        console.log('设置时间戳 ',time); 
    </script>
</body>
</html>